package com.rmiad;

import com.fliad.autotable.annotation.EnableAutoTable;
import lombok.extern.slf4j.Slf4j;
import org.noear.solon.Solon;
import org.noear.solon.annotation.SolonMain;
import org.noear.solon.scheduling.annotation.EnableScheduling;
import org.noear.solon.web.cors.CrossFilter;
import org.noear.wood.WoodConfig;

/**
 * @author wyl
 * @date 2025年02月03日 上午11:43
 */
@EnableScheduling
@EnableAutoTable // 声明使用AutoTable框架 // [!code ++]
@Slf4j
@SolonMain
public class App {

    public static void main(String[] args) {
        Solon.start(App.class, args, solonApp -> {
            // 跨域支持
            solonApp.filter(-1, new CrossFilter().allowedOrigins("*"));
            if (Solon.cfg().isDebugMode() || Solon.cfg().isFilesMode()) {
                //执行后打印sql
                WoodConfig.onExecuteAft(cmd -> {
                    log.info("[Wood]" + cmd.text + "\r\n" + cmd.paramMap());
                });
            }
        });
    }

}
